/**
 * @file config.h
 * @brief functions for dealing with config files
 * @author Scott Moyers
 * @date 2010
 */

/**
 * @page ConfigurationFiles Configuration Files
 *
 * @section AboutConfigFiles About
 * 
 * Config files allow you to set up your own genetic algorithm configuration.
 * Example configuration files can be found in the configs directory.
 *
 * @section FormatConfigFiles Format
 *
 * The general format is Command<Whitespace>Parameter\n\n
 * The following commands are available:\n\n
 * truthtable - path to a truth table file\n
 * maxgates - maximum number of gates to use in a module\n
 * size - number of modules in a population\n
 * generations - number of generations to run the GA for\n
 * selection - a selection function name (may repeat this command
 * for multiple functions or use "all" to add all selection functions)\n
 * mutation - a mutation function name (may repeat this command
 * for multiple functions or use "all" to add all mutation functions)\n
 * crossover - a crossover function name (may repeat this command
 * for multiple functions or use "all" to add all crossover functions)\n
 * maxmutations - the maximum number of mutations that can occur on one module\n
 * crossoverprob - the probability that a child is generated using crossover\n
 *
 * @section UsingConfig Using config files
 *
 * The elgalso and elgalso-gl commands both take a configuration file as input.
 *
 */

#ifndef MY_CONFIG_H
#define MY_CONFIG_H

#include "population.h"

/**
 * sets up a population with the given config file
 * @param filename the filename of the config file
 * @param pop the population to setup
 * @retval 0 if successful
 * @retval 1 if unsuccessful
 */
int load_config_file(struct Population *pop, const char *filename);

#endif
